package com.szholly.plug.form.validation;

/**
 * 常用验证正则表达式
 * @author WINSON
 *
 */
public class ValidationRegex {
	/**
	 * 中文
	 */
	public final static String CHINESE = "^[\u4e00-\u9fa5]+$";
	
	
	public final static String POSTCODE = "[1-9]\\d{5}(?!\\d)";
	public final static String EMAIL = "^\\w+([-+.]\\w+)*@\\w+([-.]\\w+)*\\.\\w+([-.]\\w+)*$";
	public final static String MOBILE_PHONE = "^((13[0-9])|(15[^4,\\D])|(18[0-9]))\\d{8}$";
	/**
	 * 身份证15位
	 */
	public final static String ID_CARD15 = "^[1-9]\\d{7}((0\\d)|(1[0-2]))(([0|1|2]\\d)|3[0-1])\\d{3}$";
	/**
	 * 身份证18位
	 */
	public final static String ID_CARD18 = "^[1-9]\\d{5}[1-9]\\d{3}((0\\d)|(1[0-2]))(([0|1|2]\\d)|3[0-1])\\d{4}$";
	
	public final static String FLOAT_NUMBER = "^[+|-]?[1-9]\\d*\\.\\d*|0\\.\\d*[1-9]\\d*$";
	public final static String INT_POSITIVE = "^[1-9]\\d*$";
	public final static String INT_NOT_POSITIVE = "^-[1-9]\\d*|0$";
	public final static String INT_NEGATIVE = "^-[1-9]\\d*$";
	public final static String INT_NOT_NEGATIVE = "^[1-9]\\d*|0$";
	public final static String INT = "^-?[1-9]\\d*|0$";
	
	public final static String DATE_YYYY_MM_DD = "^(([0-9]{3}[1-9]|[0-9]{2}[1-9][0-9]{1}|[0-9]{1}[1-9][0-9]{2}|[1-9][0-9]{3})-(((0[13578]|1[02])-(0[1-9]|[12][0-9]|3[01]))|((0[469]|11)-(0[1-9]|[12][0-9]|30))|(02-(0[1-9]|[1][0-9]|2[0-8]))))|((([0-9]{2})(0[48]|[2468][048]|[13579][26])|((0[48]|[2468][048]|[3579][26])00))-02-29)$";
	public final static String DATE_HH_MM_SS = "^([01][0-9]|2[0-3]):([0-5][0-9]):([0-5][0-9])$";
	public final static String DATE_YYYY_MM_DD_HH_MM_SS = "^((([0-9]{3}[1-9]|[0-9]{2}[1-9][0-9]{1}|[0-9]{1}[1-9][0-9]{2}|[1-9][0-9]{3})-(((0[13578]|1[02])-(0[1-9]|[12][0-9]|3[01]))|((0[469]|11)-(0[1-9]|[12][0-9]|30))|(02-(0[1-9]|[1][0-9]|2[0-8]))))|((([0-9]{2})(0[48]|[2468][048]|[13579][26])|((0[48]|[2468][048]|[3579][26])00))-02-29))\\s+([01][0-9]|2[0-3]):([0-5][0-9]):([0-5][0-9])$";
}
